FIND_PATH(DIRECT3D_INCLUDE_DIR NAMES "D3D11.h" PATHS "$ENV{DXSDK_DIR}/Include")
FIND_LIBRARY(D3D_COMPILER_LIBRARY NAMES d3dcompiler PATHS "$ENV{DXSDK_DIR}/Lib/x86")
FIND_LIBRARY(D3D_LIBRARY NAMES d3d11 PATHS "$ENV{DXSDK_DIR}/Lib/x86")
FIND_PATH(D3D_EXT_EFFECTS11_INCLUDE_DIR NAMES "d3dx11effect.h" PATHS "$ENV{DXSDK_DIR}/Samples/C++/Effects11/Inc")
IF(${CMAKE_BUILD_TYPE})
	FIND_LIBRARY(D3D_EXT_EFFECTS11_LIBRARY NAMES Effects11 PATHS "$ENV{DXSDK_DIR}/Samples/C++/Effects11/${CMAKE_BUILD_TYPE}")
ELSE()
	FIND_LIBRARY(D3D_EXT_EFFECTS11_LIBRARY NAMES Effects11 PATHS "$ENV{DXSDK_DIR}/Samples/C++/Effects11/Debug")
ENDIF()

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(DIRECTX DEFAULT_MSG D3D_COMPILER_LIBRARY D3D_LIBRARY DIRECT3D_INCLUDE_DIR D3D_EXT_EFFECTS11_INCLUDE_DIR D3D_EXT_EFFECTS11_LIBRARY)

SET(DIRECTX_LIBRARIES D3D_COMPILER_LIBRARY D3D10_LIBRARY)

MARK_AS_ADVANCED(DIRECT3D_INCLUDE_DIR DIRECTX_LIBRARIES)